<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .main{
            height: 350px;
            width: 600px;
            color: rgba(255, 255, 255, 0);
        }
    </style>
</head>

<body>
    <div class="main"></div>
    <script src="./lib/echarts.min.js"></script>
    <script>
        let myChart = echarts.init(document.querySelector('.main'))
        myChart.setOption({
            title: {
                text: '食物售价'
            },
            grid:{
                left:'20%'
            },
            legend:{
                type:'plain',
                right:'5%',
                itemStyle:{
                    color:"#86cce7"
                },
                data:[{name:'价格'}]
            },
            tooltip: {},
            xAxis: {
                data: ['西蓝花', '西瓜', '西葫芦', '西北风', '西红柿', '西芹','西洋菜']
            },
            yAxis: {},
            series: [
                {
                    name: '价格',
                    type: 'bar',
                    data: [150, 230, 224, 34, 135, 147,260],
                    colorBy:'data'
                }
            ],
            color:['#86cce9','#00ff00']
        });
    </script>
</body>

</html>